package com.code.bean;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @Author fanxs
 * @Date 2022/04/21 18:12
 * @Description 只有在容器中的组件，才会拥有SpringBoot提供的强大功能
 * 前缀定义了哪些外部属性将绑定到类的字段上
 */
@Component
@ConfigurationProperties(prefix="mycar")
public class Car {
    private String brand;
    private Integer price;

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }
}
